
CXX = g++ -g
TOBJS = obj/Socket.o obj/main.o obj/Log.o obj/Downloader.o http/URL.d
BIN = bin/
OBJ = obj/
SRC = src/
HTTP = http/
EXE = $(BIN)/download
HTTP = http/
INC = inc/

INCS = -Iinc/ -Ihttp/

#TARGETS
all:

# Binaries
main: $(BIN)main.exe
	./$(BIN)main.exe -n 5 -d http://www.google.com
	
$(BIN)main.exe: $(TOBJS)
	$(CXX) $(INCS) -o $(BIN)main $(TOBJS)


# Objects
$(OBJ)main.o: $(SRC)main.cpp
	$(CXX) $(INCS) -o $(OBJ)main.o -c $(SRC)main.cpp

$(OBJ)Socket.o: $(SRC)Socket.cpp $(INC)Socket.h
	$(CXX) $(INCS) -o $(OBJ)Socket.o -c $(SRC)Socket.cpp
	
$(OBJ)Log.o: $(SRC)Log.cpp $(INC)Log.h
	$(CXX) $(INCS) -o $(OBJ)Log.o -c $(SRC)Log.cpp

$(OBJ)Downloader.o: $(SRC)Downloader.cpp $(INC)Downloader.h inc/Log.h
	$(CXX) $(INCS) -o $(OBJ)Downloader.o -c $(SRC)Downloader.cpp